import http from "@/utils/http";

// 加入购物车
export const postMemberCart = (data) => {
    return http({
        url: '/member/cart',
        method: 'post',
        data
    })
}
// 获取购物车列表
export const getMemberCart = () => {
    return http({
        url: '/member/cart',
    })
}

/**
 * 
 * @param {String} id skuId
 * @param {Object} data selected 是否选中  count数量
 * 
 */
export const putMemberCart = (id, data) => {
    return http({
        url: `/member/cart/${id}`,
        method: 'put',
        data
    })
}
// 是否全选
export const putAllMemberCart = (data) => {
    return http({
        url: "/member/cart/selected",
        method: 'put',
        data
    })
}

// 删除商品
export const deleteMemberCart = (data) => {
    return http({
        url: "/member/cart",
        method: 'delete',
        data
    })
}